import Taro, {Component} from '@tarojs/taro'
import {View, Image, Text, RichText} from '@tarojs/components'
import './index.less'

export default class ShopList extends Component {
  constructor (props) {
    super(props)
    this.state = {
      nodes: [{
        name: 'div',
        attrs: {
          class: 'div_class',
          style: 'line-height: 100rpx; font-size:16rpx;color:#333'
        },
        children: [{
          type: 'text',
          text: '¥'
        }]
      }]
    }
  }
  render() {
    const shopListItem=this.props.data.map((item, index)=>{
      return (
        <View className='shop-item' key={index}>
          <Image src={item.img}></Image>
          <View className='shop-info'>口红信息口红信息口红信息口红信息口红信息口红信息口红信息wwwwwwww</View>
          <View className='shop-handle'>
            <Text>{item.info}</Text>
            <RichText nodes={this.state.nodes}></RichText>
            <View className='btn'>2元闯关免</View>
          </View>
        </View>
      )
    })

    return (
      <View className='shop-cont'>
        {shopListItem}
      </View>
    )
  }
}
